package com.lujieni.springbootrocketmq.controller;

import com.lujieni.springbootrocketmq.dto.CsmApproveResultMessage;
import com.lujieni.springbootrocketmq.service.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：Jie Ni
 * @Date: 2025/6/20 16:13
 * @Description:
 */
@RestController
public class CsmSendController {

    @Autowired
    private MessageProducer messageProducer;

    @PostMapping("/sendCsm")
    public String sendMessage(@RequestBody CsmApproveResultMessage payLoad) {
        messageProducer.sendMessage("csm-company-approve-topic", "lujieni", payLoad);
        return "ok";
    }

}
